// JavaScript Document

//首页导航条向下滑动固定顶部 
$(function(){
	var head = $(".head_bar");
	var bb = $(window).scrollTop();
	$(window).scroll(function(){
		bb= $(window).scrollTop();
		var x = bb/200;
		var opa = "rgba(255,255,255,"+x+")";
		var opf = "rgb(255,255,255)";
		if(bb>0){
			if(window.addEventListener){
				head.addClass("head_i").show().css({"background":opa});
				head.addClass("head_i").find(".h_ico").show().css("opacity",x);
				}else if(window.attachEvent){
					head.addClass("head_i").show().css({"background":opf});
					head.addClass("head_i").find(".h_ico").show().css("opacity",1);
					}
			
			//head.addClass("head_i").find(".greey").show(1000).css("background",opa);
			head.addClass("head_i").find(".head_center").addClass("h_c1");
			//head.addClass("head_i").find(".h_ico").show().css("opacity",x);
		}else{
			head.removeClass("head_i").css("background","url(/Public/Share/images/topbg.png) repeat-x");
			head.removeClass("head_i").find(".greey").hide();	
		}
		
	});
})

//带焦点图频道页的导航条向下滑动固定顶部 
$(function(){
	var head1 = $(".head_bar1");
	var dd = $(window).scrollTop();
	$(window).scroll(function(){
		dd= $(window).scrollTop();
		var x1 = dd/200;
		var opa1 = "rgba(255,255,255,"+x1+")";
		var opf1 = "rgb(255,255,255)";
		if(dd>0){
			if(window.addEventListener){
				head1.addClass("head_i").show().css({"background":opa1});
				head1.addClass("head_i").find(".h_ico").show().css("opacity",x1);
				}else if(window.attachEvent){
					head1.addClass("head_i").show().css({"background":opf1});
					head1.addClass("head_i").find(".h_ico").show().css("opacity",1);
					}
			//head1.addClass("head_i").find(".greey").show(1000).css("background",opa);
			head1.addClass("head_i").find(".head_center").addClass("h_c1");
			//head1.addClass("head_i").find(".h_ico").show().css("opacity",x);
		}else{
			head1.removeClass("head_i").css("background","url(/Public/Share/images/topbg.png) repeat-x");
			head1.removeClass("head_i").find(".greey").hide();
		}
		
	});
})

//不带焦点图的导航条向下滑动固定顶部 
$(function(){
	var head2 = $(".head_bar2");
	var cc = $(window).scrollTop();
	$(window).scroll(function(){
		cc= $(window).scrollTop();
		if(cc>0){
			head2.addClass("head_i");
			head2.addClass("head_i").find(".h_ico").show();
		}else{
			head2.removeClass("head_i");
		}
		
	});
})

